<%@page import="java.util.List"%>
<%@page import="com.nithya.hms.Doctor"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Hospital Management System</title>
</head>
<body>
	<%
		Doctor doctor = (Doctor) session.getAttribute("doctor");
	%>
	<table width="100%" border="1">
		<tr>
			<th><a href="<%=request.getContextPath()%>/secure/doctor-home.do">Today's Appointment</a></th>
			<th><a href="<%=request.getContextPath()%>/secure/doctor-schedule.do">My Schedule</a></th>
			<th><a href="<%=request.getContextPath()%>/secure/add-doctor.do">Add Doctor</a></th>
			<th><%=doctor.getFirstName()%> <%=doctor.getLastName()%></th>
			<th><a href="<%=request.getContextPath()%>/secure/logout.do">Logout</a></th>
		</tr>
		<tr>
			<td colspan="5" align="center" height="250px">
				<form action="save-doctor.do" method="post">
					<table border="1" width="300px">
						<tr>
							<th>First Name</th>
							<td><input type="text" name="firstName" /></td>
						</tr>
						<tr>
							<th>Last Name</th>
							<td><input type="text" name="lastName" /></td>
						</tr>
						<tr>
							<th>Email Id</th>
							<td><input type="text" name="emailId" /></td>
						</tr>
						<tr>
							<th>Password</th>
							<td><input type="text" name="password" /></td>
						</tr>
						<tr>
							<th>Mobile</th>
							<td><input type="text" name="mobile" /></td>
						</tr>
						<tr>
							<td colspan="2" align="center"><input type="submit"
								value="Add Doctor" /> <input type="reset" value="Cancel" /></td>
						</tr>
					</table>
				</form>
			</td>
		</tr>
		<tr>
			<td colspan="4" align="center">
				<table border="1" width="300px">
					<tr>
						<th>Id</th>
						<th>First Name</th>
						<th>Last Name</th>
						<th>Email Id</th>
						<th>Password</th>
						<th>Mobile</th>
					</tr>

					<%
						List<Doctor> list = (List<Doctor>) request.getAttribute("list");
						for (Doctor doc : list) {
					%>

					<tr>
						<td><%=doc.getId()%></td>
						<td><%=doc.getFirstName()%></td>
						<td><%=doc.getLastName()%></td>
						<td><%=doc.getEmailId()%></td>
						<td><%=doc.getPassword()%></td>
						<td><%=doc.getMobile()%></td>
					</tr>

					<%
						}
					%>

				</table>
			</td>

		</tr>
	</table>
</body>
</html>